import 'package:json_annotation/json_annotation.dart';

part 'user_bean.g.dart';

@JsonSerializable(nullable: false)
class UserModel{

  @JsonKey(name: 'id')
  String userId;

  @JsonKey(name: 'nick_name')
  String nickName;

  @JsonKey(name: 'sex')
  int sex;

  @JsonKey(name: 'first_name')
  String firstName;

  @JsonKey(name: 'last_name')
  String lastName;

  @JsonKey(name: 'age')
  int age;

  UserModel(this.userId, this.nickName,this.sex,this.firstName,this.lastName,this.age,);

  factory UserModel.fromJson(Map<String, dynamic> srcJson) => _$UserModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$UserModelToJson(this);

}